package com.taotao.module.bigdata.consumer.conf;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.stereotype.Component;

import java.util.Properties;

/**
 * @author liutao
 * @desc 搜索服务的基础环境配置
 */
@Component
public class BaseEnviromentConf {


    private BaseEnviromentConf() {
    }


    private static class ConfHolder {
        private static Properties CONF = environment();
    }


    public static Properties singletonEnvironment() {
        return ConfHolder.CONF;
    }

    private static Properties environment() {

        try {
            return PropertiesLoaderUtils.loadProperties(new ClassPathResource("application-prod.properties"));

        } catch (Exception e) {
            e.getLocalizedMessage();
        }
        return null;
    }

}
